gl: Drop OpenGL legacy profile
authorEmmanuele Bassi <ebassi@gnome.org>
Wed, 28 Jan 2015 19:04:22 +0000 (19:04 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Mon, 9 Feb 2015 19:10:30 +0000 (19:10 +0000)
We simply don't want to care about legacy OpenGL.

All supported platforms also have support for OpenGL ≥ 3.2; it would
complicate the internal code; and would force us to use legacy GL
contexts internally if the first context created by the user is a legacy
GL context, and disable creation of core-3.2 contexts after that.

We will need to fix all our code examples to use the Core 3.2 profile.

https://bugzilla.gnome.org/show_bug.cgi?id=741946

gdk/gdkglcontext.c
gdk/gdktypes.h
gdk/gdkwindow.c
gdk/x11/gdkglcontext-x11.c

index 55ee9f1ca6ae3d8a7d25752bf1ea267aba6999d0..3ffaf8f8c230c3ccbcdcebda7e869b805af9607a 100644 (file)
@@ -553,11 +553,6 @@ gdk_gl_context_get_required_version (GdkGLContext *context,
       switch (priv->profile)
         {
         case GDK_GL_PROFILE_DEFAULT:
-        case GDK_GL_PROFILE_LEGACY:
-          if (major != NULL)
-            *major = 1;
-          break;
-
         case GDK_GL_PROFILE_3_2_CORE:
           if (major != NULL)
             *major = 3;
@@ -572,11 +567,6 @@ gdk_gl_context_get_required_version (GdkGLContext *context,
       switch (priv->profile)
         {
         case GDK_GL_PROFILE_DEFAULT:
-        case GDK_GL_PROFILE_LEGACY:
-          if (minor != NULL)
-            *minor = 0;
-          break;
-
         case GDK_GL_PROFILE_3_2_CORE:
           if (minor != NULL)
             *minor = 2;
@@ -740,7 +730,7 @@ gdk_gl_context_get_profile (GdkGLContext *context)
 {
   GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
 
-  g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), GDK_GL_PROFILE_LEGACY);
+  g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), GDK_GL_PROFILE_DEFAULT);
 
   return priv->profile;
 }
index 5b0a656fa1bcfe56b61337e131583de178ae94fa..2a377d82303b6f897f0d8f328ccaf25f7758ec60 100644 (file)
@@ -435,18 +435,28 @@ struct _GdkPoint
 
 /**
  * GdkGLProfile:
- * @GDK_GL_PROFILE_DEFAULT: ...
- * @GDK_GL_PROFILE_LEGACY: ...
- * @GDK_GL_PROFILE_3_2_CORE: ...
+ * @GDK_GL_PROFILE_DEFAULT: The default profile.
+ * @GDK_GL_PROFILE_3_2_CORE: Use core 3.2 GL profiles
  *
- * ...
+ * The profile to be used when creating a #GdkGLContext.
+ *
+ * Since: 3.16
  */
 typedef enum {
   GDK_GL_PROFILE_DEFAULT,
-  GDK_GL_PROFILE_LEGACY,
   GDK_GL_PROFILE_3_2_CORE
 } GdkGLProfile;
 
+/**
+ * GdkGLError:
+ * @GDK_GL_ERROR_NOT_AVAILABLE: OpenGL support is not available
+ * @GDK_GL_ERROR_UNSUPPORTED_FORMAT: The requested visual format is not supported
+ * @GDK_GL_ERROR_UNSUPPORTED_PROFILE: The requested profile is not supported
+ *
+ * Error enumeration for #GdkGLContext.
+ *
+ * Since: 3.16
+ */
 typedef enum {
   GDK_GL_ERROR_NOT_AVAILABLE,
   GDK_GL_ERROR_UNSUPPORTED_FORMAT,
index 9cc257b49aa66665d53266cf2ec276f631dc4aa1..94a09c78d0e4b0769e54efec34bfe2d537653a2d 100644 (file)
@@ -2742,21 +2742,9 @@ gdk_window_get_paint_gl_context (GdkWindow  *window,
       window->impl_window->gl_paint_context =
         GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
                                                                      TRUE,
-                                                                     GDK_GL_PROFILE_3_2_CORE,
+                                                                     GDK_GL_PROFILE_DEFAULT,
                                                                      NULL,
                                                                      &internal_error);
-      if (window->impl_window->gl_paint_context == NULL &&
-          g_error_matches (internal_error, GDK_GL_ERROR,
-                           GDK_GL_ERROR_UNSUPPORTED_PROFILE))
-        {
-          g_clear_error (&internal_error);
-          window->impl_window->gl_paint_context =
-            GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
-                                                                         TRUE,
-                                                                         GDK_GL_PROFILE_DEFAULT,
-                                                                         NULL,
-                                                                         &internal_error);
-        }
     }
 
   if (internal_error != NULL)
index 8b11c82c6cf01b25de9e8d3b359438aeb731c9ab..cde1e093316d4fee1beb086dd1d32253d2f59230 100644 (file)
@@ -609,10 +609,6 @@ gdk_x11_gl_context_realize (GdkGLContext  *context,
   profile = gdk_gl_context_get_profile (context);
   share = gdk_gl_context_get_shared_context (context);
 
-  /* GDK_GL_PROFILE_DEFAULT is currently equivalent to the LEGACY profile */
-  if (profile == GDK_GL_PROFILE_DEFAULT)
-    profile = GDK_GL_PROFILE_LEGACY;
-
   /* we check for the presence of the GLX_ARB_create_context_profile
    * extension before checking for a GLXFBConfig.
    */
@@ -1193,7 +1189,7 @@ gdk_x11_window_create_gl_context (GdkWindow    *window,
 
   display = gdk_window_get_display (window);
 
-  /* GDK_GL_PROFILE_DEFAULT is currently equivalent to the LEGACY profile */
+  /* GDK_GL_PROFILE_DEFAULT is currently equivalent to the 3_2_CORE profile */
   if (profile == GDK_GL_PROFILE_DEFAULT)
     profile = GDK_GL_PROFILE_3_2_CORE;